let loginUrl = 'ido/login'
let getUserinfoUrl = 'getInfo'
let updateUserUrl = 'ido/student'
let sendCommunicationUrl = 'ido/app/communication/send';
let getCommunicationUrl = 'ido/app/communication/list';
// 企业员工注册所用
let registerUrl = 'ido/app/user/worker/register'
function loginApi(vm){
	// 默认params为空
	let login = (params = {}) => vm.$u.post(loginUrl, params)
	let getUserinfo = () => vm.$u.get(getUserinfoUrl)
	// 更新用户信息（注意是用户，不是具体的某一个学生、老师这种），主要是更新用户的 avatar、sex、email、phonenumber
	let updateUser = (params = {}) => vm.$u.put(updateUserUrl, params)
	
	/* 2.聊天接口 */
	// 2.1 增加聊天内容
	let sendCommunication = (params = {}) => vm.$u.post(sendCommunicationUrl, params)
	// 2.2 获取聊天内容
	let getCommunication = (params = {}) => vm.$u.get(getCommunicationUrl, params)
	// 企业员工注册
	let register = (params = {}) => vm.$u.post(registerUrl, params)
	return {login,getUserinfo,updateUser,sendCommunication,getCommunication}
}

export default loginApi
// export default {login,getUserinfo,updateUser,sendCommunication,getCommunication}
